package cn.xspace.wnx.util;

import rx.Subscription;
import rx.subscriptions.CompositeSubscription;

/**
 * Created by Administrator on 2016/12/10.
 */

public class RxUtil {

    public static RxUtil instance;

    public static RxUtil getInstance() {
        if (instance == null) {
            instance = new RxUtil();
        }
        return instance;
    }

    private RxUtil() {

    }

    private final CompositeSubscription mAllSubscription = new CompositeSubscription();

    public void registerSubscription(Subscription subscription) {
        mAllSubscription.add(subscription);
    }

    public void unregisterSubscription(Subscription subscription) {
        mAllSubscription.remove(subscription);
    }

}
